/**
 * 环境配置
 */
class Env {
  local = {
    client_id: 'client_1',
    client_secret: '123456',
    // location: 'https://test.sungpu.com:65',
    // location: 'http://localhost:8080',
    location: 'http://localhost',
    serverUrl: function () {
      // return `${this.location}:8086/api`
      return `/resource`
    },
    loginUrl: function () {
      // return `${this.location}:9090/manage-auth/oauth/token`
      return `/manage-auth/oauth/token`
    },
    logoutUrl: function () {
      // return `${this.location}:9090/manage-auth/logout`
      // return `/manage-auth/logout`
      return `/manage-auth/oauth/logout`
    },
    validateCodeUrl: function (cacheKey) {
      // return `${this.location}:9090/manage-auth/logout`
      // return `/manage-auth/logout`
      return `/manage-auth/validate-code/${cacheKey}`
    }
  }
  dev = {
    client_id: 'resource-client',
    client_secret: 'Adwj@238&^',
    location: 'https://manage-test.sungpu.com',
    serverUrl: function () {
      // return `${this.location}:8086/api`
      return `/resource`
    },
    loginUrl: function () {
      // return `${this.location}:9090/manage-auth/oauth/token`
      return `/manage-auth/oauth/token`
    },
    logoutUrl: function () {
      // return `${this.location}:9090/manage-auth/logout`
      // return `/manage-auth/logout`
      return `/manage-auth/oauth/logout`
    },
    validateCodeUrl: function (cacheKey) {
      // return `${this.location}:9090/manage-auth/logout`
      // return `/manage-auth/logout`
      return `/manage-auth/validate-code/${cacheKey}`
    }
  }
  prd = {
    client_id: 'resource-client',
    client_secret: 'Adwj@238&^',
    location: '',
    serverUrl: function () {
      // return `${this.location}:8086/api`
      return `${this.location}/api`
    },
    loginUrl: function () {
      // return `${this.location}:9090/manage-auth/oauth/token`
      return `${this.location}/manage-auth/oauth/token`
    },
    logoutUrl: function () {
      // return `${this.location}:9090/manage-auth/logout`
      // return `/manage-auth/logout`
      return `${this.location}/manage-auth/oauth/logout`
    },
    validateCodeUrl: function (cacheKey) {
      // return `${this.location}:9090/manage-auth/logout`
      // return `/manage-auth/logout`
      return `${this.location}/manage-auth/validate-code/${cacheKey}`
    }
  }
}
export default new Env()
